interface Inter{
    public void func();
}
class TextA implements Inter{
    @Override
    public void func() {
        System.out.println("重写的funcA方法");
    }
}

public class In {
    public void text(){
        class fang{
            public int a;
        }
    }
    public static void main(String[] args) {

    }
    public static void main2(String[] args) {
        new In(){

        };
    }
    public static void main1(String[] args) {
//new Inter(){
//    @Override
//    public void func() {
//        System.out.println("匿名类的方法");
//    }
//}.func();
       Inter a= new Inter(){
            @Override
            public void func() {
                System.out.println("匿名类的方法");
            }
        };
         a.func();
    }
}
